@model IEnumerable<OpenPac.Models.MediaOutlet>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th></th>
        <th>
            Name
        </th>
        <th>
            Type
        </th>
        <th>
            Abbreviation
        </th>
        <th>
            PerceivedBias
        </th>
        <th>
            PrimaryContact
        </th>
        <th>
            PrimaryContactType
        </th>
        <th>
            PrimaryContactValue
        </th>
        <th>
            SecondaryContact
        </th>
        <th>
            SecondaryContactType
        </th>
        <th>
            SecondaryContactValue
        </th>
        <th>
            Districts
        </th>
        <th>
            ImportantIssues
        </th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.Id }) |
            @Html.ActionLink("Details", "Details", new { id=item.Id }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.Id })
        </td>
        <td>
			@item.Name
        </td>
        <td>
			@item.Type
        </td>
        <td>
			@item.Abbreviation
        </td>
        <td>
			@item.PerceivedBias
        </td>
        <td>
			@item.PrimaryContact
        </td>
        <td>
			@item.PrimaryContactType
        </td>
        <td>
			@item.PrimaryContactValue
        </td>
        <td>
			@item.SecondaryContact
        </td>
        <td>
			@item.SecondaryContactType
        </td>
        <td>
			@item.SecondaryContactValue
        </td>
        <td>
			@(item.Districts == null ? "None" : item.Districts.Count.ToString())
        </td>
        <td>
			@(item.ImportantIssues == null ? "None" : item.ImportantIssues.Count.ToString())
        </td>
    </tr>
}

</table>


